<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <%--    post详细内容页面--%>
    <title>${post.postTitle}</title>
    <script type="text/javascript" src="/static/js/jquery-3.4.1.js"></script>
    <link rel="stylesheet" type="text/css" href="/static/css/content.css"/>
</head>
<body>
<jsp:include page="head.jsp"/>
<div class="all">
    <div class="content">
        <div class="div-title div-title2">
            <div>
                <div>${post.postTitle}</div>

                <div>
                    <a href="/reply" class="content-button">回复</a>
                </div>

            </div>
        </div>
        <div class="left">
            <table id="table1">
                <tbody id="group_one">
                <tr style="height: auto">
                    <td class="left-td-top">

                        <div class="div-namelogo">
                            <a href="#">
                                <img class="img" src="${post.user.userPhoto}" alt="用户头像"/>
                            </a>
                        </div>
                        <div class="div-name">
                            <a href="others/others.jsp?uid=${post.userId}">
                                <span class="yansebianhuan">${post.user.userName}</span>
                            </a>
                        </div>
                        <br>
                        <div class="div-content-icon">
                            <a href="#"><img class="img" src="${post.postPhoto}"
                                             alt="内容配图"/></a>
                        </div>
                        <div class="div-content">
									<span>
                                        ${post.postContent}
                                    </span>
                        </div>
                        <c:forEach items="${replies}" var="reply">
                <tr style="height: auto">
                    <td class="left-td-top">

                        <div class="div-namelogo">
                            <a href="#">
                                <img class="img" src="${reply.user.userPhoto}" alt="用户头像"/>
                            </a>
                        </div>
                        <div class="div-name">
                            <a href="others/others.jsp?uid=${reply.userId}">
                                <span class="yansebianhuan">${reply.user.userName}</span>
                            </a>
                        </div>
                        <br>
                        <div class="div-content-icon">
                            <a href="#"><img class="img" src="${reply.replyPhoto}"
                                             alt="内容配图"/></a>
                        </div>
                        <div class="div-content">
                        <span>
                                ${reply.replyContent}
                        </span>
                        </div>
                    </td>
                </tr>
                </td>
                </tr>
                </c:forEach>
                </tbody>
            </table>
            <span id="s"></span>
            <br><br>
        </div>
    </div>
</div>
</body>
<script>
    function toReply() {
        $.ajax({
            url: "/reply",
            method: "get",
            success: function () {
                window.location.href = "/reply";
            },
            error: function () {
                alert("请求出错")
            }
        })
    }
</script>
</html>
